Skip to content

feat(orchestration): instance-shaped session model + harness roster components#4589

Merged
senamakel merged 9 commits into
tinyhumansai:mainfrom
oxoxDev:feat/orchestration-instance-roster
Jul 6, 2026
Merged

feat(orchestration): instance-shaped session model + harness roster components#4589
senamakel merged 9 commits into
tinyhumansai:mainfrom
oxoxDev:feat/orchestration-instance-roster

Conversation

@oxoxDev

@oxoxDev oxoxDev commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Turns each orchestration session into a first-class instance on the wire: SessionSummary now carries harnessType (claude/codex/gemini), a coarse status, and a currentTask one-liner.
  • Adds the roster component set — InstanceStatusDot (5-state primitive), HarnessGlyph, InstanceCard, TinyPlaceRoster (grouped by harness) — the building blocks for the multi-instance view of the Orchestration tab.
  • No user-facing wiring yet: these components + backend fields are self-contained and unit-tested; composing them into the tab is deferred to the layout-rewrite PR so this change stays independently mergeable.

Problem

The Orchestration tab's unit is a flat chat/contact. As it grows into a hub for many external agent instances (Claude / Codex / Gemini), the screen needs to answer "what are my agents, grouped by harness, and what is each doing right now" — which the current session shape can't express: the emitting harness is already on the ingest envelope (HarnessInfo.provider) but never surfaced, and there is no notion of per-instance status or current activity in the read model.

Solution

  • Core (orchestration): SessionSummary gains harnessType (derived from the session source, which already stores the provider for harness windows), status (derived: idle when the session has recent traffic, else stopped — richer running/waiting-approval/errored states are modelled but reserved for the attention-queue / run-state follow-ups), and currentTask (latest message preview via a new latest_message_preview store query, UTF-8-safe truncation). Pinned master/subconscious/user-created windows report no harness.
  • Renderer: matching HarnessType / InstanceStatus types + fields on the client SessionSummary; four presentational components ported from the design mockups, each with co-located tests. TinyPlaceRoster groups instances by harness (Claude/Codex/Gemini, then an "Other" catch-all), excludes the pinned windows, and renders an empty state.
  • Full i18n (roster + status strings) across en + 13 locales.

Submission Checklist

  • Tests added or updated (happy path + at least one failure / edge case) — rust: harness-type mapping, status derivation, UTF-8 task-preview cap, summarize composition, latest_message_preview (newest/none/scoping); frontend: 19 cases across the 4 components (states, grouping, empty, selection, handle fallback).
  • Diff coverage ≥ 80% — unit tests pass; full local diff-cover not run. Backend derivations + all four components are directly unit-tested; relying on CI's diff-coverage gate.
  • Coverage matrix updated — N/A: additive read-model + presentational components, no matrix feature row.
  • All affected feature IDs listed under ## RelatedN/A (no matrix IDs).
  • No new external network dependencies introduced.
  • Manual smoke checklist updated — N/A: no release-cut surface (components not yet mounted).
  • Linked issue closed via Closes #NNNN/A: design-driven, no tracking issue.

Impact

  • Desktop only. Additive: three derived fields on the orchestration read model (no schema/migration change — source already holds the provider, task line reads existing messages) + four presentational components + i18n. No behavior change to existing chat/pairing/ingest flows.
  • status is intentionally coarse today (idle/stopped) since peer instances carry no true run-state; the component set already models all five states for later work.

Related

  • Closes: N/A
  • Follow-up PR(s)/TODOs: attention queue (waiting/errored routing); layout rewrite wiring RelayBadge + SelfIdentityCard + this roster into the tab; external instance launch/control.

AI Authored PR Metadata (required for Codex/Linear PRs)

Linear Issue

  • Key: N/A
  • URL: N/A

Commit & Branch

  • Branch: feat/orchestration-instance-roster
  • Commit SHA: see PR head

Validation Run

  • pnpm --filter openhuman-app format:check
  • pnpm typecheck
  • Focused tests: vitest run on the 4 component specs + tab spec (32 passed); cargo test --lib openhuman::orchestration:: (61 passed)
  • Rust fmt/check (if changed): cargo fmt --check, cargo check, cargo clippy --lib
  • Tauri fmt/check (if changed): N/A — no app/src-tauri changes

Validation Blocked

  • command: N/A
  • error: N/A
  • impact: N/A

Behavior Changes

  • Intended behavior change: instance-shaped read model + roster components; nothing mounted in the UI yet.
  • User-visible effect: none in this PR (components wired in the layout-rewrite follow-up).

Parity Contract

  • Legacy behavior preserved: existing session/message/ingest flows unchanged; new fields are additive and derived.
  • Guard/fallback/dispatch parity checks: harness-less/pinned windows fall back cleanly (no harness, idle/stopped status).

Duplicate / Superseded PR Handling

  • Duplicate PR(s): none
  • Canonical PR: this
  • Resolution: N/A

Summary by CodeRabbit

  • New Features

    • Added a new roster view for agent instances with grouped entries, empty-state handling, and selectable cards.
    • Added status indicators, harness labels, unread badges, and short task previews on instance rows.
    • Expanded language support for the new roster and status labels across multiple locales.
  • Bug Fixes

    • Improved session display so handles take priority over raw identifiers when available.
    • Added safer handling for missing instance details, including default status and fallback labeling.

oxoxDev added 9 commits July 6, 2026 22:20
Newest message body for a session (by timestamp then seq), scoped to
(agent, session) — powers the roster's one-line current-task, following the
same per-session read pattern as unread_count.
… summary

SessionSummary now carries the emitting harness (derived from the session
source: claude/codex/gemini), a coarse status (idle when active, else stopped —
richer run-state deferred), and the latest-message task preview (UTF-8-safe
truncation). Pinned/sentinel windows report no harness. Unit-tested.
…fields

Adds HarnessType, InstanceStatus and the harnessType/status/currentTask fields
to the renderer SessionSummary, matching the core RPC shape.
Five-state status dot (running/idle/waiting-approval/errored/stopped) with
color + pulse, the core roster primitive. Presentational, accessible label.
Brand mark for the driving harness (Claude/Codex/Gemini) plus an OpenHuman mark
for internal windows; identity hues, token-based for the codex mark.
Harness glyph + status dot + identity (@handle/label/short address) + one-line
current task + unread pill; selectable. Presentational.
Instance roster grouping external agent sessions by harness (Claude/Codex/
Gemini, then an Other catch-all), each a selectable InstanceCard; excludes the
pinned master/subconscious windows; empty state. Presentational.
SessionSummary now requires status; backfill the existing tab-test fixtures.
8 keys (tinyplaceOrchestration.roster.* + .status.*) with real translations
across en + 13 locales for the roster and InstanceCard status labels.
@oxoxDev oxoxDev requested a review from a team July 6, 2026 16:55
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds session status/harness metadata end-to-end: a Rust store helper for latest message previews, orchestration schema fields (harness_type, status, current_task) with derivation logic, client SessionSummary type updates, new UI components (HarnessGlyph, InstanceStatusDot, InstanceCard, TinyPlaceRoster), and roster/status translations across all locales.

Changes

Roster status and instance UI

Layer / File(s) Summary
Store preview helper and status derivation
src/openhuman/orchestration/store.rs, src/openhuman/orchestration/schemas.rs
Adds latest_message_preview store query and extends SessionSummary DTO/summarize with harness_type, status, current_task derivation, wired into session list/create/pinned-placeholder handlers, with tests.
Client SessionSummary type extension
app/src/lib/orchestration/orchestrationClient.ts
Adds HarnessType/InstanceStatus union types and extends SessionSummary with harnessType, status, currentTask.
HarnessGlyph and InstanceStatusDot
app/src/components/intelligence/HarnessGlyph.tsx, HarnessGlyph.test.tsx, InstanceStatusDot.tsx, InstanceStatusDot.test.tsx
New presentational components mapping harness/status values to labels, colors, and accessibility attributes, with tests.
InstanceCard component
app/src/components/intelligence/InstanceCard.tsx, InstanceCard.test.tsx
New roster row component combining glyph, status dot, identity, current task, unread pill, selection styling, and click handling, with tests.
TinyPlaceRoster grouping component
app/src/components/intelligence/TinyPlaceRoster.tsx, TinyPlaceRoster.test.tsx
New component that filters/groups sessions by harness (Claude/Codex/Gemini/Other) and renders InstanceCard rows with selection and handle resolution, with tests.
Existing test fixture updates
app/src/components/intelligence/TinyPlaceOrchestrationTab.test.tsx
Adds required status: 'idle' field to mocked session fixtures used across existing tests.
Roster/status translations
app/src/lib/i18n/*.ts
Adds tinyplaceOrchestration.roster.* and tinyplaceOrchestration.status.* keys across all supported locale files.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Roster as TinyPlaceRoster
  participant Card as InstanceCard
  participant Handler as handle_sessions_list
  participant Store as orchestration store

  Handler->>Store: latest_message_preview(agent_id, session_id)
  Store-->>Handler: latest message body or None
  Handler->>Handler: task_preview(body)
  Handler->>Handler: summarize(session, current_task)
  Handler-->>Roster: SessionSummary[] (harnessType, status, currentTask)
  Roster->>Roster: group sessions by harness
  Roster->>Card: render InstanceCard per session
  Card->>Card: render HarnessGlyph + InstanceStatusDot
Loading

Possibly related PRs

  • tinyhumansai/openhuman#4425: Both PRs extend the orchestration storage layer; this PR's latest_message_preview queries the SQLite store introduced in the retrieved PR.
  • tinyhumansai/openhuman#4430: This PR extends the SessionSummary model and UI built on the orchestration RPC/UI foundation introduced in the retrieved PR.

Suggested labels: feature, agent

Suggested reviewers: M3gA-Mind, sanil-23

Poem

A rabbit hops through roster rows,
Glyphs and dots in tidy rows,
Claude and Codex, Gemini too,
Status pulses running through 🐰
Eight locales sing the same refrain—
"Instances are here again!"

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: an instance-shaped orchestration model plus new harness roster UI components.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot added agent Built-in agents, prompts, orchestration, and agent runtime in src/openhuman/agent/. feature Net-new user-facing capability or product behavior. labels Jul 6, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/openhuman/orchestration/schemas.rs (1)

208-269: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Derivation logic belongs in ops.rs, not schemas.rs.

harness_type_for, derive_status, and task_preview are pure business/derivation logic, but they're added to schemas.rs. As per coding guidelines, schemas.rs is for "RPC-facing schemas and delegating handlers" while business logic belongs in ops.rs. This file already has some pre-existing drift (is_active, chat_kind_for_session), but the new derivation helpers compound it rather than correcting it.

♻️ Suggested direction

Move harness_type_for, derive_status, task_preview (and ideally is_active/chat_kind_for_session as a follow-up) into ops.rs, and have schemas.rs import and delegate to them from summarize/handle_sessions_list/pinned_placeholder.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/openhuman/orchestration/schemas.rs` around lines 208 - 269, The new
derivation helpers in schemas.rs are misplaced business logic; move
harness_type_for, derive_status, and task_preview into ops.rs and keep
schemas.rs limited to RPC-facing types and delegation. Update summarize and any
related callers such as handle_sessions_list and pinned_placeholder to import
and use the ops.rs implementations, and if practical, include the existing
is_active/chat_kind_for_session drift in the same cleanup or as a follow-up.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@src/openhuman/orchestration/schemas.rs`:
- Around line 208-269: The new derivation helpers in schemas.rs are misplaced
business logic; move harness_type_for, derive_status, and task_preview into
ops.rs and keep schemas.rs limited to RPC-facing types and delegation. Update
summarize and any related callers such as handle_sessions_list and
pinned_placeholder to import and use the ops.rs implementations, and if
practical, include the existing is_active/chat_kind_for_session drift in the
same cleanup or as a follow-up.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d54b5c12-fc79-4df1-b722-19aee3051181

📥 Commits

Reviewing files that changed from the base of the PR and between f88197a and aadbab8.

📒 Files selected for processing (26)
  • app/src/components/intelligence/HarnessGlyph.test.tsx
  • app/src/components/intelligence/HarnessGlyph.tsx
  • app/src/components/intelligence/InstanceCard.test.tsx
  • app/src/components/intelligence/InstanceCard.tsx
  • app/src/components/intelligence/InstanceStatusDot.test.tsx
  • app/src/components/intelligence/InstanceStatusDot.tsx
  • app/src/components/intelligence/TinyPlaceOrchestrationTab.test.tsx
  • app/src/components/intelligence/TinyPlaceRoster.test.tsx
  • app/src/components/intelligence/TinyPlaceRoster.tsx
  • app/src/lib/i18n/ar.ts
  • app/src/lib/i18n/bn.ts
  • app/src/lib/i18n/de.ts
  • app/src/lib/i18n/en.ts
  • app/src/lib/i18n/es.ts
  • app/src/lib/i18n/fr.ts
  • app/src/lib/i18n/hi.ts
  • app/src/lib/i18n/id.ts
  • app/src/lib/i18n/it.ts
  • app/src/lib/i18n/ko.ts
  • app/src/lib/i18n/pl.ts
  • app/src/lib/i18n/pt.ts
  • app/src/lib/i18n/ru.ts
  • app/src/lib/i18n/zh-CN.ts
  • app/src/lib/orchestration/orchestrationClient.ts
  • src/openhuman/orchestration/schemas.rs
  • src/openhuman/orchestration/store.rs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent Built-in agents, prompts, orchestration, and agent runtime in src/openhuman/agent/. feature Net-new user-facing capability or product behavior.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants